﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <!-- fugging Scrollbars -->
    <ControlTemplate x:Key="HorizontalScrollBar"
                     TargetType="{x:Type ScrollBar}">
        <Grid x:Name="Root">
            <Grid.Resources>
                <ControlTemplate x:Key="RepeatButtonTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root"
                          Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalIncrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                              Height="10"
                              Stretch="Uniform"
                              Width="6"
                              Fill="{DynamicResource GrayBrush1}" />
                        <Path x:Name="HoverPath"
                              Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                              Height="10"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,1,0,0"
                              Fill="{DynamicResource BlackBrush}" />
                        <Path x:Name="Blur"
                              Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                              Height="10"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,1,0,0"
                              Fill="{DynamicResource BlackBrush}">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                        </Path>
                        <Rectangle x:Name="DisabledElement"
                                   Fill="{DynamicResource WhiteBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalDecrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                              Height="10"
                              Stretch="Uniform"
                              Width="6"
                              Fill="{DynamicResource GrayBrush1}" />
                        <Path x:Name="HoverPath"
                              Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                              Height="10"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0,1,0,0"
                              Fill="{DynamicResource BlackBrush}" />
                        <Path x:Name="Blur"
                              Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                              Height="10"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0,1,0,0"
                              Fill="{DynamicResource BlackBrush}">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                        </Path>
                        <Rectangle x:Name="DisabledElement"
                                   Fill="{DynamicResource WhiteBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalThumbTemplate"
                                 TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="ThumbVisual">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual"
                              Margin="0,1,0,1">
                            <Rectangle x:Name="Background"
                                       StrokeThickness="1"
                                       Fill="{DynamicResource ThumbBrush}" />
                            <Rectangle x:Name="MouseOverRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{DynamicResource BlackBrush}" />
                            <Rectangle x:Name="PressedRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{DynamicResource BlackBrush}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0.5" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="HorizontalRoot"
                  Height="{TemplateBinding Height}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="0.00001*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <RepeatButton x:Name="HorizontalSmallDecrease"
                              Command="ScrollBar.LineLeftCommand"
                              Width="16"
                              IsTabStop="False"
                              Interval="50"
                              Margin="1"
                              Grid.Column="0"
                              Template="{DynamicResource HorizontalDecrementTemplate}" />
                <Track x:Name="PART_Track"
                       IsDirectionReversed="False"
                       Grid.Column="1">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton x:Name="HorizontalLargeDecrease"
                                      Command="ScrollBar.PageLeftCommand"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{DynamicResource RepeatButtonTemplate}" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb Template="{DynamicResource HorizontalThumbTemplate}" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton x:Name="HorizontalLargeIncrease"
                                      Command="ScrollBar.PageRightCommand"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{DynamicResource RepeatButtonTemplate}" />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton x:Name="HorizontalSmallIncrease"
                              Command="ScrollBar.LineRightCommand"
                              Width="{DynamicResource HorizontalScrollBarRepeatButtonWidth}"
                              IsTabStop="False"
                              Interval="50"
                              Margin="1"
                              Grid.Column="2"
                              Template="{DynamicResource HorizontalIncrementTemplate}" />
            </Grid>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="VerticalScrollBar"
                     TargetType="{x:Type ScrollBar}">
        <Grid x:Name="Root">
            <Grid.Resources>
                <ControlTemplate x:Key="RepeatButtonTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root"
                          Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalIncrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="10"
                              Margin="0.5,0,0.5,0"
                              Fill="{DynamicResource GrayBrush1}" />
                        <Path x:Name="HoverPath"
                              Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="10"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0.5,0,0.5,0"
                              Fill="{DynamicResource BlackBrush}" />
                        <Path x:Name="Blur"
                              Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="10"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0.5,0,0.5,0"
                              Fill="{DynamicResource BlackBrush}">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                        </Path>
                        <Rectangle x:Name="DisabledElement"
                                   Fill="{DynamicResource WhiteBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalDecrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="10"
                              Margin="0.5,0,0,0"
                              Fill="{DynamicResource GrayBrush1}" />
                        <Path x:Name="HoverPath"
                              Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="10"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,0,0,0"
                              Fill="{DynamicResource BlackBrush}" />
                        <Path x:Name="Blur"
                              Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="10"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0,0,2,0"
                              Fill="{DynamicResource BlackBrush}">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                        </Path>
                        <Rectangle x:Name="DisabledElement"
                                   Fill="{DynamicResource WhiteBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalThumbTemplate"
                                 TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="ThumbVisual">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual"
                              Margin="1,0,1,0">
                            <Rectangle x:Name="Background"
                                       StrokeThickness="1"
                                       Fill="{DynamicResource ThumbBrush}" />
                            <Rectangle x:Name="MouseOverRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{DynamicResource BlackBrush}" />
                            <Rectangle x:Name="PressedRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{DynamicResource BlackBrush}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0.5" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="VerticalRoot"
                  Width="{TemplateBinding Width}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="0.00001*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <RepeatButton x:Name="VerticalSmallDecrease"
                              Command="ScrollBar.LineUpCommand"
                              Height="16"
                              IsTabStop="False"
                              Interval="50"
                              Margin="1"
                              Grid.Row="0"
                              Template="{DynamicResource VerticalDecrementTemplate}" />
                <Track x:Name="PART_Track"
                       IsDirectionReversed="true"
                       Grid.Row="1">
                    <Track.Resources>
                        <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">50</System:Double>
                    </Track.Resources>
                    <Track.DecreaseRepeatButton>
                        <RepeatButton x:Name="VerticalLargeDecrease"
                                      Command="ScrollBar.PageUpCommand"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{DynamicResource RepeatButtonTemplate}" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb Template="{DynamicResource VerticalThumbTemplate}" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton x:Name="VerticalLargeIncrease"
                                      Command="ScrollBar.PageDownCommand"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{DynamicResource RepeatButtonTemplate}" />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton x:Name="VerticalSmallIncrease"
                              Command="ScrollBar.LineDownCommand"
                              Height="{DynamicResource VerticalScrollBarRepeatButtonHeight}"
                              IsTabStop="False"
                              Interval="50"
                              Margin="1"
                              Grid.Row="2"
                              Template="{DynamicResource VerticalIncrementTemplate}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <!-- Style for overall  ScrollBar -->
    <Style x:Key="MetroScrollBar"
           TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="OverridesDefaultStyle"
                Value="true" />
        <Style.Triggers>
            <Trigger Property="Orientation"
                     Value="Horizontal">
                <Setter Property="Width"
                        Value="Auto" />
                <Setter Property="Height"
                        Value="{DynamicResource MetroScrollBarHeight}" />
                <Setter Property="Template"
                        Value="{DynamicResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation"
                     Value="Vertical">
                <Setter Property="Width"
                        Value="{DynamicResource MetroScrollBarWidth}" />
                <Setter Property="Height"
                        Value="Auto" />
                <Setter Property="Template"
                        Value="{DynamicResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MetroScrollViewer"
           TargetType="{x:Type ScrollViewer}">
        <Setter Property="Controls:ControlsHelper.VerticalScrollBarOnLeftSide"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid x:Name="Grid"
                          Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"
                                              x:Name="leftColumn" />
                            <ColumnDefinition Width="Auto"
                                              x:Name="rightColumn" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
                                                CanContentScroll="{TemplateBinding CanContentScroll}"
                                                CanHorizontallyScroll="False"
                                                CanVerticallyScroll="False"
                                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                                Content="{TemplateBinding Content}"
                                                Grid.Column="0"
                                                Margin="{TemplateBinding Padding}"
                                                Grid.Row="0" />
                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                   AutomationProperties.AutomationId="VerticalScrollBar"
                                   Cursor="Arrow"
                                   Grid.Column="1"
                                   Maximum="{TemplateBinding ScrollableHeight}"
                                   Minimum="0"
                                   Grid.Row="0"
                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                   Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                   ViewportSize="{TemplateBinding ViewportHeight}" />
                        <ScrollBar x:Name="PART_HorizontalScrollBar"
                                   AutomationProperties.AutomationId="HorizontalScrollBar"
                                   Cursor="Arrow"
                                   Grid.Column="0"
                                   Maximum="{TemplateBinding ScrollableWidth}"
                                   Minimum="0"
                                   Orientation="Horizontal"
                                   Grid.Row="1"
                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                   Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                   ViewportSize="{TemplateBinding ViewportWidth}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Controls:ControlsHelper.VerticalScrollBarOnLeftSide"
                                 Value="True">
                            <Setter TargetName="leftColumn"
                                    Property="Width"
                                    Value="Auto" />
                            <Setter TargetName="rightColumn"
                                    Property="Width"
                                    Value="Auto" />
                            <Setter TargetName="PART_ScrollContentPresenter"
                                    Property="Grid.Column"
                                    Value="1" />
                            <Setter TargetName="PART_VerticalScrollBar"
                                    Property="Grid.Column"
                                    Value="0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
